package com.usian;

import com.usian.pojo.TbContent;
import com.usian.pojo.TbContentCategory;
import com.usian.utils.AdNode;
import com.usian.utils.PageResult;
import com.usian.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "usian-content-service")
public interface ContentFeign {

    @RequestMapping("selectContentCategoryByParentId")
    public List<TbContentCategory> selectContentCategoryByParentId(@RequestParam Long id);

    /**
     * 添加内容节点
     *
     * @param parentId
     * @param name
     * @return
     */
    @RequestMapping("insertContentCategory")
    public Integer insertContentCategory(@RequestParam Long parentId,@RequestParam String name );


    /**
     * 删除节点
     *
     * @param categoryId
     * @return
     */
    @RequestMapping("deleteContentCategoryById")
    public Integer deleteContentCategoryById(@RequestParam Long categoryId);

    /**
     *
     * 分页查询商品内容
     *
     * @param categoryId
     * @param page
     * @param rows
     * @return
     */
    @RequestMapping("selectTbContentAllByCategoryId")
    public PageResult selectTbContentAllByCategoryId(@RequestParam Long categoryId,
                                                     @RequestParam Integer page, @RequestParam Integer rows);

    /**
     * 保存商品内容信息
     *
     * @param tbContent
     * @return
     */
    @RequestMapping("insertTbContent")
    public Integer insertTbContent(TbContent tbContent);


    /**
     * 删除商品内容信息
     *
     * @param ids
     * @return
     */
    @RequestMapping("deleteContentByIds")
    public Integer deleteContentByIds(@RequestParam  Long ids);

    /**
     * 首页查询大广告
     *
     * @return
     */
    @RequestMapping("selectFrontendContentByAD")
    public List<AdNode> selectFrontendContentByAD();

}
